#include <QWidget>
#include "../Core/ImageObj.h"

class Helper;
class QPaintEvent;

typedef unsigned char byte;

class PaintWidget : public QWidget
{
	Q_OBJECT

public:
	PaintWidget(QWidget *parent);
	virtual void mouseMoveEvent ( QMouseEvent * event );
	virtual void mousePressEvent ( QMouseEvent * event );
	virtual void mouseReleaseEvent(QMouseEvent * event);
	void paintImage(ImageObj **img);
	void paintCropImage();
	QImage* image;

protected:
	void paintEvent(QPaintEvent *event);
	int mousePositionX;
	int mousePositionY;
	int button;

	//selection
	QRect *selection;
	QColor *selectionColor;
	long selectionX;
	long selectionY;
	long selectionWidth;
	long selectionHeight;


	//image
	int imagePositionX;
	int clickTempPositionX;
	int imagePositionY;
	int clickTempPositionY;
	ImageObj **imageObj;
	bool imagePainted;
	bool moveImage;

public slots:
	void cropImage();

};
